package com.intgrt.manager.util;

import org.apache.shiro.SecurityUtils;

import com.intgrt.manager.entity.SysUser;

/**
 * 用户信息类 可从中获取当前登陆用的信息
 */
public class UserInfo {
	/**
	 * 记录用户操作时间，若时间过长则需重新登陆
	 */
	private static long operateTime;
	
	public static SysUser getUser(){
		return (SysUser) SecurityUtils.getSubject().getPrincipal();
	}

	public static long getOperateTime() {
		return operateTime;
	}
	public static void setOperateTime(long operateTime) {
		UserInfo.operateTime = operateTime;
	}
	
	public static String getId(){
		return getUser().getId();
	}
	public static String getAccname(){
		return getUser().getAccname();
	}
	public static String getOrgid(){
		return getUser().getOrgid();
	}
	public static String getRoleid(){
		return getUser().getRoleid();
	}
	
}
